/**
 * 
 */
package org.iridium.allcomments.persistance;

/**
 * @author iridium
 * 
 */
public interface UserInfoDAO {

	/**
	 * add an item
	 * 
	 * @param userId
	 *            user ID
	 * @param nickname
	 * @param realName
	 * @param sex
	 * @param age
	 * @param location
	 *            where the user lives now
	 * @param question
	 *            the question for modifying password
	 * @param answer
	 *            the answer to the question
	 * @param mobile
	 * @param email
	 */
	public void addItem(long userId, String nickname, String realName, int sex,
			int age, String location, String question, String answer,
			String mobile, String email);

	/**
	 * add a user with very basic info
	 * 
	 * @param userId
	 * @param loginName
	 * @param password
	 * @param email
	 * @param nickname
	 * @param roleId
	 */
	public void addItem(long userId, String loginName, String password,
			String email, String nickname, int roleId);

	/**
	 * delete a user's registered information
	 * 
	 * @param userId
	 */
	public void delItem(long userId);

	/**
	 * update all the info
	 * 
	 * @param userId
	 * @param nickname
	 * @param realName
	 * @param sex
	 * @param age
	 * @param location
	 * @param question
	 * @param answer
	 * @param mobile
	 * @param email
	 */
	public void updateItem(long userId, String nickname, String realName,
			int sex, int age, String location, String question, String answer,
			String mobile, String email);

	/**
	 * modify password
	 * 
	 * @param userId
	 * @param password
	 */
	public void updatePassword(long userId, String password);

	/**
	 * modify role ID
	 * 
	 * @param userId
	 * @param roleId
	 */
	public void updateRoleId(long userId, int roleId);

	/**
	 * modify nickname
	 * 
	 * @param userId
	 * @param nickname
	 */
	public void updateNickname(long userId, String nickname);

	/**
	 * modify real name
	 * 
	 * @param userId
	 * @param realName
	 */
	public void updateRealName(long userId, String realName);

	/**
	 * modify sex
	 * 
	 * @param userId
	 * @param sex
	 */
	public void updateSex(long userId, int sex);

	/**
	 * modify age
	 * 
	 * @param userId
	 * @param age
	 */
	public void updateAge(long userId, int age);

	/**
	 * modify location
	 * 
	 * @param userId
	 * @param location
	 */
	public void updateLocation(long userId, String location);

	/**
	 * modify question
	 * 
	 * @param userId
	 * @param question
	 */
	public void updateQuestion(long userId, String question);

	/**
	 * modify answer
	 * 
	 * @param userId
	 * @param answer
	 */
	public void updateAnswer(long userId, String answer);

	/**
	 * modify cell phone number
	 * 
	 * @param userId
	 * @param mobile
	 */
	public void updateMobile(long userId, String mobile);

	/**
	 * modify the contact email
	 * 
	 * @param userId
	 * @param email
	 */
	public void updateEmail(long userId, String email);

	/**
	 * test if there is a user whose id is userId
	 * 
	 * @param userId
	 * @return true if there is, or false
	 */
	boolean existsUser(long userId);

	/**
	 * query a user's password
	 * 
	 * @param userId
	 * @return password (in pain or encryption?)
	 */
	public String queryPassword(long userId);

	/**
	 * query a user's role ID
	 * 
	 * @param userId
	 * @return role ID
	 */
	public int queryRoleId(long userId);

}
